<!-- 国际事业 -->
<template>
  <div class="career">
    <header v-if="data.career_back" :style="'background: url(' + data.career_back + ') no-repeat 50% 50%;'">
      <span>{{ i18n.career.career }}</span>
    </header>
    <div class="career">
      <div class="list" v-for="val in data.module" :key="val.id">
        <i></i>
        <p>
          <b>{{val.title}}</b>
          {{val.content}}
        </p>
      </div>
    </div>
    <div class="international">
      <main>
        <h1>{{data.career_title}}</h1>
        <div v-for="val in data.module2" :key="val.id" class="list">
          <h3>{{val.title}}</h3>
          <p>
            {{val.content}}
          </p>
        </div>
      </main>
    </div>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';
import bus from "@/config/emit";

export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  data() {
    //这里存放数据
    return {
        data:{}
    };
  },
  //计算属性 类似于data概念
  computed: {
    i18n() {
      return this.$t("message");
    },
  },
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    getCareer() {
      this.$getRequest("/index/getCareer").then((res) => {
        this.data=res.data
      });
    },
  },
  beforeCreate() {}, //生命周期 - 创建之前
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {
    this.getCareer();
    bus.$on("lang", () => {
      if (this.$route.name == "/career") {
        this.getCareer();
      }
    });
  },
  beforeMount() {}, //生命周期 - 挂载之前
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {
    this.getCareer();
  }, //如果页面有keep-alive缓存功能，激活
  deactivated() {}, //如果页面有keep-alive缓存功能，非激活
};
</script>
<style lang="less">
.career {
  & > .international {
    width: 100%;
    min-height: 17.5rem;
    background: url("../assets/career/3.png") no-repeat 50% 50%;
    background-size: auto 100%;
    margin: 0.875rem auto;
    & > main {
      width: 17.5rem;
      margin: 0 auto;
      padding-top: 1px;
      color: #fff;
      & > h1 {
        font-size: 0.625rem;
        text-align: center;
        margin: 1.0625rem 0 1.25rem;
      }
      & > .list {
        width: 100%;
        font-size: 0.3125rem;
        & > h3 {
          font-size: 0.375rem;
          margin: 0.375rem 0;
        }
      }
    }
  }

  & > .career {
    width: 17.5rem;
    min-height: 8.5rem;
    background: url("../assets/career/4.png") no-repeat 50% 50%;
    background-size: 100% auto;
    margin: 0.875rem auto;

    & > .list {
      width: 100%;
      display: flex;
      margin-bottom: 0.875rem;

      & > p {
        flex: 1;
        display: flex;
        flex-direction: column;
        font-size: 0.3125rem;

        & > b {
          font-size: 0.375rem;
          line-height: 0.4rem;
          margin-bottom: 0.325rem;
        }
      }

      & > i {
        width: 0.4rem;
        height: 0.4rem;
        background: url("../assets/career/2.png") no-repeat;
        background-size: 100% 100%;
        margin-right: 0.3125rem;
      }
    }
  }

  & > header {
    width: 100%;
    height: 7.5rem;
    background-size: 100% 100% !important;
    color: #fff;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
  }
}

@media screen and (max-width: 768px) {
  .career {
    & > .international {
      min-height: 40rem;
      margin: 1rem auto;
      padding-bottom: 1rem;
      box-sizing: border-box;
      & > main {
        width: 33.5rem;
        padding-top: 1px;
        & > h1 {
          font-size: 1.5rem;
          text-align: center;
          margin: 1rem 0 1.5rem;
        }
        & > .list {
          font-size: 1rem;
          & > h3 {
            font-size: 1.2rem;
            margin: 1rem 0;
          }
        }
      }
    }
    & > .career {
      width: 33.5rem;
      min-height: 24rem;
      margin: 1rem auto;

      & > .list {
        margin-bottom: 1rem;

        & > p {
          font-size: 1rem;

          & > b {
            font-size: 1.2rem;
            line-height: 2rem;
            margin-bottom: 1rem;
          }
        }

        & > i {
          width: 2rem;
          height: 2rem;
          margin-right: 1rem;
        }
      }
    }

    & > header {
      height: 20rem;
      background-size: auto 100% !important;
      font-size: 1.5rem;
    }
  }
}
</style>